package com.heliming.data.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.heliming.data.entity.User;
import com.heliming.data.service.ReadService;
import com.heliming.data.utils.ResultPage;

@RestController
@RequestMapping("/read")
public class ReadController {
	
	@Autowired
	private ReadService readService;
	
	@GetMapping("/detail/{id}")
	public String detail(@PathVariable String id){
		User user = readService.findById(id);
		return ResultPage.successToJsonString(user);
	}

}
